package com.edu.flying_birds;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;

/**
 * @PackageName: com.edu.flying_birds
 * @ClassName: ImgUtils
 * @Description: 工具类
 * @author: RZS
 * @date: 2021/6/16  16:10
 */
public class ImgUtils {
    /**
     * 获取图片资源
     * @param imgPath
     * @return
     * @throws IOException
     */
    public static BufferedImage getImg(String imgPath) throws IOException {
        return ImageIO.read(ImgUtils.class.getResource(imgPath));
    }
}
